Skip to content

fix(permissions): let long approval prompts scroll to their controls#3080

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-permission-prompt-scroll
Draft

fix(permissions): let long approval prompts scroll to their controls#3080
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-permission-prompt-scroll

Conversation

@posthog

@posthog posthog Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

In a cloud run, when a command needs approval and its text is long, the approval prompt fills the pane and the approve/deny choices render below the visible area with no way to scroll to them. Reported for a Codex/GPT cloud run: the controls were unreachable and the only workaround was to switch tasks, navigate back, and press enter.

Changes

The pending-permission region in SessionView combined shrink-0 with overflow-y-auto — a contradiction. A non-shrinking flex item keeps its full content height, so overflow-y-auto never engaged; once the prompt exceeded the pane, the controls at the bottom were clipped with no scroll.

The region is now shrinkable (shrink), so it collapses to the available pane height and its overflow-y-auto engages, keeping the approve/deny controls reachable. The conversation scroller above it is flex-1 (basis 0) and yields space first, so the prompt only shrinks once it would otherwise overflow the pane — normal-length prompts are unchanged.

How did you test this?

Reproduced the exact SessionView bottom-region flex layout (a flex-1 scroller above the permission region, in a short pane) in Storybook with a long command, and drove it with a headless browser, measuring the position of the last control ("No, keep working") relative to the pane:

  • Before (shrink-0): the region is not a scroll container. After scrolling everything possible, the control sits at y≈275px, below the 240px pane — clipped and unreachable (matches the report's "half a line visible" symptom).
  • After (shrink): the region becomes a scroll container (scrollHeight 341 > clientHeight 238). Scrolling brings the same control to y≈176px, inside the pane — all three options and the keyboard-hint footer are reachable.

Biome check passes on the changed file.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code from an inbox report.

The pending-permission region in SessionView used `shrink-0` together with
`overflow-y-auto`. Because a non-shrinking flex item keeps its full content
height, `overflow-y-auto` never engaged: when a command was long enough that
the prompt exceeded the pane, the approve/deny controls were pushed below the
visible area with no way to scroll to them.

Make the region shrinkable (`shrink`) so it collapses to the available pane
height and its `overflow-y-auto` engages, keeping the controls reachable. The
conversation scroller above is `flex-1` with basis 0, so it yields space first
and the prompt only shrinks once it would otherwise overflow.

Generated-By: PostHog Code
Task-Id: 84a6c574-786a-49ea-9965-fc6eb972822d
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ab67f70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants